Artigos relacionados

*   [Guia de instalação](/index.php/Guia_de_instala%C3%A7%C3%A3o "Guia de instalação")
*   [Recomendações gerais](/index.php/Recomenda%C3%A7%C3%B5es_gerais "Recomendações gerais")
*   [Solução de problemas gerais](/index.php/General_troubleshooting "General troubleshooting")

Esta página explica como realizar uma instalação normal do Arch em um pendrive (também conhecido como "unidade flash" ou, em inglês, de *USB key*). Em contraste com o fato de ter um LiveUSB coberto em [Mídia de instalação em flash USB](/index.php/M%C3%ADdia_de_instala%C3%A7%C3%A3o_em_flash_USB "Mídia de instalação em flash USB"), o resultado será uma instalação persistente idêntica à instalação normal em HDD, mas em uma unidade flash USB.

## Contents

*   [1 Instalação](#Instala.C3.A7.C3.A3o)
    *   [1.1 Ajustes na instalação](#Ajustes_na_instala.C3.A7.C3.A3o)
*   [2 Configuração](#Configura.C3.A7.C3.A3o)
    *   [2.1 GRUB legado](#GRUB_legado)
    *   [2.2 GRUB](#GRUB)
    *   [2.3 Syslinux](#Syslinux)
*   [3 Dicas](#Dicas)
    *   [3.1 Usando sua instalação USB em múltiplas máquinas](#Usando_sua_instala.C3.A7.C3.A3o_USB_em_m.C3.BAltiplas_m.C3.A1quinas)
        *   [3.1.1 Drivers de entrada](#Drivers_de_entrada)
        *   [3.1.2 Drivers de vídeo](#Drivers_de_v.C3.ADdeo)
        *   [3.1.3 Nomenclatura de dispositivos de bloco persistentes](#Nomenclatura_de_dispositivos_de_bloco_persistentes)
        *   [3.1.4 Parâmetros do kernel](#Par.C3.A2metros_do_kernel)
        *   [3.1.5 Inicializando de mídia USB 3.0](#Inicializando_de_m.C3.ADdia_USB_3.0)
    *   [3.2 Compatibilidade](#Compatibilidade)
    *   [3.3 Minimizando o acesso a disco](#Minimizando_o_acesso_a_disco)
*   [4 Veja também](#Veja_tamb.C3.A9m)

## Instalação

**Nota:** Recomenda-se pelo menos 2 GB de espaço de armazenamento. Um conjunto modesto de pacotes vai caber, deixando um pouco de espaço livre para armazenamento.

Existem várias maneiras de instalar o Arch em um pendrive, dependendo do sistema operacional disponível:

*   Se você tem outro computador Linux disponível (não precisa ser o Arch), você pode seguir as instruções em [Instalar a partir de um Linux existente](/index.php/Instalar_a_partir_de_um_Linux_existente "Instalar a partir de um Linux existente").
*   Um Arch Linux CD/USB pode ser usado para instalar o Arch no pendrive, através da inicialização do CD/USB e seguindo o [guia de instalação](/index.php/Guia_de_instala%C3%A7%C3%A3o "Guia de instalação"). Se for inicializar de um Live USB, a instalação terá que ser feita em um pendrive diferente.
*   Se você usar Windows ou OS X, faça o download do VirtualBox, instale as VirtualBox Extensions, adicione a unidade USB a uma máquina virtual executando o Arch (por exemplo, executando a partir de uma ISO), aponte a instalação para a unidade USB enquanto usa as instruções no [Guia de instalação](/index.php/Guia_de_instala%C3%A7%C3%A3o "Guia de instalação").

### Ajustes na instalação

*   Antes de criar o disco de RAM inicial com `# mkinitcpio -p linux`, em `/etc/mkinitcpio.conf` adicione o *hook* `block` ao vetor de *hooks* logo após o udev. Isso é necessário para o carregamento apropriado do módulo desde cedo no espaço do usuário.
*   É altamente recomendável revisar o artigo wiki sobre [redução leitura/escrita de disco](/index.php/Improving_performance#Reduce_disk_reads.2Fwrites "Improving performance") antes de selecionar um sistema de arquivos. Resumindo, [ext4 sem um jornal](http://fenidik.blogspot.com/2010/03/ext4-disable-journal.html) está bom, o qual pode ser criado com `# mkfs.ext4 -O "^has_journal" /dev/sdXX`. A desvantagem óbvia de usar um sistema de arquivos com o *journaling* desativado é a perda de dados como resultado de uma desmontagem desajeitada. Reconheça que o flash tem um número limitado de gravações, e um sistema de arquivos com *journaling* levará alguns deles à medida que o journal for atualizado. Por esse mesmo motivo, é melhor nem pensar a partição swap. Observe que isso não afeta a instalação em um disco rígido USB.
*   Se você quiser continuar a usar o dispositivo UFD como uma unidade removível multiplataforma, isso pode ser feito criando uma partição que hospede um sistema de arquivos apropriado (provavelmente NTFS ou exFAT). Observe que a partição de dados pode precisar ser a primeira partição no dispositivo, pois o Windows pressupõe que só pode haver uma partição em um dispositivo removível e, de outra forma, terá uma montagem automática de uma partição do sistema EFI. Lembre-se de instalar [dosfstools](https://www.archlinux.org/packages/?name=dosfstools) e [ntfs-3g](https://www.archlinux.org/packages/?name=ntfs-3g). Algumas ferramentas estão disponíveis on-line que podem permitir que você mude o bit de mídia removível em seu dispositivo UFD. Isso faria com que os sistemas operacionais tratassem seu dispositivo UFD como um disco rígido externo e permitisse que você usasse qualquer esquema de particionamento escolhido.

**Atenção:** Não é possível mudar o bit de mídia removível em todos os dispositivos UFD e tentar usar software incompatível com o dispositivo pode danificá-lo. A tentativa de mudar o bit de mídia removível **não** é recomendada.

## Configuração

*   Make sure that `/etc/fstab` includes the correct partition information for `/`, and for any other partitions on the USB key. If the usb key is to be booted on several machines, it is quite likely that devices and number of available hard disks vary. So it is advised to use UUID or label:

To get the proper UUIDs for your partitions issue **blkid**

**Note:**

*   When GRUB is installed on the USB key, the key will always be `hd0,0`.
*   It seems that current versions of GRUB will automatically default to using uuid. The following directions are for GRUB legacy.

### GRUB legado

`menu.lst`, the GRUB legacy configuration file, should be edited to (loosely) match the following: With the static `/dev/sda*X*`:

```
root (hd0,0)
kernel /boot/vmlinuz-linux root=/dev/sda1 ro
initrd /boot/initramfs-linux.img

```

When using label your menu.lst should look like this:

```
root (hd0,0)
kernel /boot/vmlinuz-linux root=/dev/disk/by-label/**Arch** ro
initrd /boot/initramfs-linux.img

```

And for UUID, it should be like this:

```
root (hd0,0)
kernel /boot/vmlinuz-linux root=/dev/disk/by-uuid/3a9f8929-627b-4667-9db4-388c4eaaf9fa ro
initrd /boot/initramfs-linux.img

```

### GRUB

On GPT with UEFI installations, make sure you follow the instructions on [GRUB#UEFI systems](/index.php/GRUB#UEFI_systems "GRUB") and include the --removable option as doing otherwise may break existing GRUB installations, as in the below command:

```
# grub-install --target=x86_64-efi --efi-directory=$esp --bootloader-id=grub **--removable** --recheck

```

### Syslinux

With the static `/dev/sda*X*`:

```
LABEL Arch
        MENU LABEL Arch Linux
        LINUX ../vmlinuz-linux
        APPEND root=/dev/sdax ro
        INITRD ../initramfs-linux.img

```

Using your UUID:

```
LABEL Arch
        MENU LABEL Arch Linux
        LINUX ../vmlinuz-linux
        APPEND root=UUID=3a9f8929-627b-4667-9db4-388c4eaaf9fa ro
        INITRD ../initramfs-linux.img

```

## Dicas

### Usando sua instalação USB em múltiplas máquinas

#### Drivers de entrada

For laptop use (or use with a tactile screen) you will need the [xf86-input-synaptics](https://www.archlinux.org/packages/?name=xf86-input-synaptics) package for the touchpad/touchscreen to work.

For instructions on fine tuning or troubleshooting touchpad issues, see the [Touchpad Synaptics](/index.php/Touchpad_Synaptics "Touchpad Synaptics") article.

#### Drivers de vídeo

**Note:** The use of proprietary video drivers is **not** recommended for this type of installation.

To support most common GPUs, install [xf86-video-vesa](https://www.archlinux.org/packages/?name=xf86-video-vesa), [xf86-video-ati](https://www.archlinux.org/packages/?name=xf86-video-ati), [xf86-video-intel](https://www.archlinux.org/packages/?name=xf86-video-intel), [xf86-video-amdgpu](https://www.archlinux.org/packages/?name=xf86-video-amdgpu), and [xf86-video-nouveau](https://www.archlinux.org/packages/?name=xf86-video-nouveau).

#### Nomenclatura de dispositivos de bloco persistentes

It is recommended to use [UUID](/index.php/UUID "UUID") in both [fstab](/index.php/Fstab "Fstab") and bootloader configuration. See [Persistent block device naming](/index.php/Persistent_block_device_naming "Persistent block device naming") for details.

Alternatively, you may create udev rule to create custom symlink for your usb key. Then use this symlink in fstab and bootloader configuration. See [udev#Setting static device names](/index.php/Udev#Setting_static_device_names "Udev") for details.

#### Parâmetros do kernel

You may want to disable KMS for various reasons, such as getting a blank screen or a "no signal" error from the display, when using some Intel video cards, etc. To disable KMS, add `nomodeset` as a kernel parameter. See [Kernel parameters](/index.php/Kernel_parameters "Kernel parameters") for more info.

**Warning:** Some [Xorg](/index.php/Xorg "Xorg") drivers will not work with KMS disabled. See the wiki page on your specific driver for details. Nouveau in particular needs KMS to determine the correct display resolution. If you add `nomodeset` as a kernel parameter as a preemptive measure you may have to adjust the display resolution manually when using machines with Nvidia video cards. See [Xrandr](/index.php/Xrandr "Xrandr") for more info.

#### Inicializando de mídia USB 3.0

See [[1]](http://www.wyae.de/docs/boot-usb3/).

### Compatibilidade

The fallback image should be used for maximum compatibility.

### Minimizando o acesso a disco

*   You may want to configure [journald](/index.php/Systemd#Journal "Systemd") to store its journals in RAM, e.g. by creating a custom configuration file:

 `/etc/systemd/journald.conf.d/usbstick.conf` 
```
[Journal]
Storage=volatile
RuntimeMaxUse=30M
```

*   To disable `fsync` and related system calls in web browsers and other applications that do not write essential data, use the *eatmydata* command from [libeatmydata](https://aur.archlinux.org/packages/libeatmydata/) to avoid such system calls:

```
$ eatmydata firefox

```

## Veja também

*   [Installing Arch Linux from VirtualBox](/index.php/Installing_Arch_Linux_from_VirtualBox "Installing Arch Linux from VirtualBox")
*   [Solid State Drives](/index.php/Solid_State_Drives "Solid State Drives")